{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import shutil\n",
    "dirs = ['Permutation_MAvDY']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Permutation_MAvDY\n"
     ]
    }
   ],
   "source": [
    "for d in os.listdir('graph_outputs/') :\n",
    "    if d in dirs:\n",
    "        shutil.copytree('graph_outputs/'+d, 'NAACLAttention/graph_outputs_new/' + d)\n",
    "        print(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "dirname = 'NAACLAttention/graph_outputs_new/GradientPval_kendalltau/'\n",
    "for f in os.listdir(dirname) :\n",
    "    if f.endswith('.csv') :\n",
    "        df = pd.read_csv(dirname + '/' + f, index_col=0)\n",
    "        if len(df.index) > 1 :\n",
    "            df = df[df.index != 'Overall']\n",
    "            df.to_csv(dirname + '/' + f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
